#include "opencv2/opencv.hpp"

using namespace cv;
int main(void)
{
#pragma region ch1
	//const char *fn = "E:\\opencv\\sources\\samples\\data\\lena.jpg";
	//Mat image = imread(fn);
	//imshow("Hello,world!", image);
	//waitKey(0);
#pragma endregion

#pragma region CH2
	const char *fn = "E:\\opencv\\sources\\samples\\data\\lena.jpg";
	Mat image1 = imread(fn);
	imshow("CH2", image1);
	Mat image, rgb, rgbChannels[3], hsv, hsvChannels[3];
	pyrDown(image1, image);
	cvtColor(image, rgb, COLOR_BGR2RGB);
	split(rgb, rgbChannels);
	imshow("R", rgbChannels[0]);
	imshow("G", rgbChannels[1]);
	imshow("B", rgbChannels[2]);

	cvtColor(image, hsv, COLOR_BGR2HSV);
	split(hsv, hsvChannels);
	imshow("Hue", hsvChannels[0]);
	imshow("Saturation", hsvChannels[1]);
	imshow("Value", hsvChannels[2]);
	waitKey(0);
#pragma endregion


}